﻿<Window x:Class="Shoozla.View.SummaryView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Background="#DFDFDF"
        Title="Shoozla Tag Editor" Height="356" Width="445" ResizeMode="NoResize" Topmost="True" WindowStartupLocation="CenterOwner" WindowStyle="SingleBorderWindow" ShowInTaskbar="False">
    <DockPanel LastChildFill="True" Background="{StaticResource BackgroundBrush}">
        <Button Command="{Binding Path=CmdClose}" Grid.Row="6" Grid.ColumnSpan="2" DockPanel.Dock="Bottom" Content="Close" Style="{DynamicResource CmdButton}" ></Button>
        <Grid DataContext="{Binding Path=Song}">
            <Grid.RowDefinitions>
                <RowDefinition Height="20"/>
                <RowDefinition Height="20"/>
                <RowDefinition Height="20"/>
                <RowDefinition Height="20"/>
                <RowDefinition Height="180"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="60"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <TextBlock Text="File" HorizontalAlignment="Left" Margin="7,0,0,0" VerticalAlignment="Top" Grid.Row="5" Grid.Column="0" FontSize="12" ></TextBlock>
            <TextBlock Text="Artist"   HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="0" Grid.Column="0" FontSize="12" ></TextBlock>
            <TextBlock Text="Title"  HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="1" Grid.Column="0" FontSize="12"></TextBlock>
            <TextBlock Text="Album" HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="2" Grid.Column="0" FontSize="12"></TextBlock>
            <TextBlock Text="Genre"  HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="3" Grid.Column="0" FontSize="12"></TextBlock>
            <TextBlock Text="Cover"  HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="4" Grid.Column="0" FontSize="12"></TextBlock>

            <TextBlock Text="{Binding FileName}" Padding="7,0,0,0" Background="White"  Grid.Row="5" Grid.Column="1"  FontSize="12" Width="362" HorizontalAlignment="left" VerticalAlignment="Top" TextWrapping="Wrap" FontStyle="Italic" Foreground="Black" Height="33"></TextBlock>
            <TextBox Text="{Binding Artist, Mode=TwoWay}" Grid.Column="1" Width="362"  FontSize="12" HorizontalAlignment="left"  VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding Title, Mode=TwoWay}" Grid.Row="1"  Grid.Column="1" Width="362"  FontSize="12" HorizontalAlignment="left"  VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding AlbumName, Mode=TwoWay}" Grid.Row="2"  Grid.Column="1" Width="362"   FontSize="12" HorizontalAlignment="left"  VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding Genre, Mode=TwoWay}" Grid.Row="3"  Grid.Column="1" Width="230"   FontSize="12" HorizontalAlignment="left"  VerticalAlignment="Center" Foreground="Black"></TextBox>
            <WrapPanel  Grid.Row="3" Grid.Column="1" >
                <TextBlock Text="Year"  HorizontalAlignment="left"  Margin="240,0,0,0" VerticalAlignment="Center" FontSize="12"></TextBlock>
                <TextBox Text="{Binding Year, Mode=TwoWay}" Width="89"  FontSize="12" Margin="10,0,0,0" VerticalAlignment="Center" ></TextBox>
            </WrapPanel>
            
            <Grid Grid.Row="4" Grid.Column="1" Margin="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Image Source="{Binding ImageBitmap}"  Width="140" Height="140" VerticalAlignment="Center" Grid.Row="0" HorizontalAlignment="Center"/>
                <WrapPanel  Grid.Row="1" HorizontalAlignment="Center">
                    <WrapPanel.Triggers>
                        <EventTrigger RoutedEvent="Button.Click" SourceName="btnPlay">
                            <EventTrigger.Actions>
                                <BeginStoryboard Name="AudioStoryBoard">
                                    <Storyboard x:Name="Storyboard"  SlipBehavior="Slip">
                                        <MediaTimeline Source="{Binding FileName}" Storyboard.TargetName="audio"></MediaTimeline>
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
               
                        <EventTrigger RoutedEvent="Button.Click" SourceName="btnStop">
                            <EventTrigger.Actions>
                                <StopStoryboard BeginStoryboardName="AudioStoryBoard" />
                            </EventTrigger.Actions>
                        </EventTrigger>
                        
                    </WrapPanel.Triggers>
                    <MediaElement x:Name="audio"></MediaElement>
                    <Button Name="btnPlay" Style="{StaticResource CmdButtonTransparent}">
                        <Image Source="/Shoozla;component/Images/play.png" Width="30" Stretch="UniformToFill"/>
                    </Button>

                    <Button Name="btnStop" Style="{StaticResource CmdButtonTransparent}">
                        <Image Source="/Shoozla;component/Images/stop.png" Width="30" Stretch="UniformToFill"/>
                    </Button>
                </WrapPanel>
            </Grid>


        </Grid>
    </DockPanel>
</Window>
